<script setup lang="ts">
import { ref, reactive, h } from "vue";
import { getListApi } from "/@/api/system/access-log";
// import { useModal } from '/@/hooks/useModal'
// import { useTableNotCheck, useDeleteSucessMessage, useConfirm } from '/@/hooks/useMessage'

// 表格配置
const tableRef = ref<YTableInstance>();
const tableProps = reactive<YTableProps>({
  height: "auto",
  columns: [
    { field: 'path', label: 'URL', filter: true },
    { field: 'ip', label: 'IP', filter: true },
    { field: 'requestMethod', label: '请求方法', filter: true },
    { field: 'elapsedTime', label: '耗时(ms)', },
    {
      field: 'success', label: '成功', formatter: 'bool', filterComponent: {
        key: 'SelectMaker',
        props: {
          options: [
            { label: '成功', value: true },
            { label: '失败', value: false },
          ]
        }
      }
    },
    { field: 'responseMessage', label: '响应消息', },
    { field: 'browser', label: '浏览器', filter: true },
    { field: 'os', label: '系统', filter: true },
    { field: 'accessTime', label: '访问时间', formatter: 'dateTime', filterComponent: 'ElDatePicker' },
    { field: 'accessUser', label: '访问人', },
  ],
  remoteConfig: {
    api: getListApi,
    immediate: true
  },
});

</script>
<template>
  <IndexLayout>
    <YTable v-bind="tableProps" ref="tableRef"></YTable>
  </IndexLayout>
</template>